<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>循环</title>
	<style type="text/css">
	.box{
		width: 760px;
		height: 500px;
		margin: 50px auto;
		background: #F4645F url() 0 0 no-repeat;
	}
	.little{
		width: 700px;
		height: 30px;
		color: #fff;
		line-height: 30px;
		padding-top: 20px;
		margin:0px auto;
	}
	table{
		width:700px;
		height: 320px;
		margin: 20px auto;
		padding: 10px;
		background: #fff url() 0 0 no-repeat; 
	}
	</style>
	<script type="text/javascript">
	document.write("<div class='box'>")
	document.write("<div class='little'>")
	document.write("通过学习了循环，输出一个九九乘法表")
	document.write("</div>")
	document.write("<br />")
	document.write("<table>")
	for (var i = 9; i>=1; i--) {
		if(i%2==0){
		document.write("<tr style='background:red' border='1'>")
				for(var j=1;j<=i;j++){
						if (j%2==0) {
						document.write("<td border='1' style='background:#D4DBED'>")
						document.write(i+"x"+j+"="+i*j)
						document.write("</td>")
					}else{
						document.write("<td border='1' style='background:red'>")
						document.write(i+"x"+j+"="+i*j)
						document.write("</td>")
					}
				}
		document.write("</tr>")
	}else{
			for(var j=1;j<=i;j++){
						if (j%2==0) {
						document.write("<td border='1' style='background:blue'>")
						document.write(i+"x"+j+"="+i*j)
						document.write("</td>")
					}else{
						document.write("<td border='1' style='background:red'>")
						document.write(i+"x"+j+"="+i*j)
						document.write("</td>")
					}
				}
	}
		};
	
	document.write("</table>");
	document.write("</div>")
	</script>
<boy>
</body>
</html>